<template>
  <div class="article-item">
    <van-cell-group>
      <van-cell :title="article.title" :to="'/article/' + article.art_id">
        <!-- 标签插槽 -->
        <div class="costom-label" slot="label">
          <div class="cover-img" v-if="article.cover.type === 3">
            <van-image v-for="(item,i) in article.cover.images" :key="i" fit="cover" :src="item" />
          </div>
          <span>{{article.aut_name}}</span>
          <span class="common">{{article.comm_count}}评论</span>
          <span>{{article.pubdate | formatDate}}</span>
        </div>
        <!-- 默认插槽 -->
        <van-image v-if="article.cover.type === 1" fit="cover" :src="article.cover.images[0]" class="right-img" />
      </van-cell>
    </van-cell-group>
  </div>
</template>

<script>
export default {
  name: 'ArticleItem',
  props: {
    article: {
      type: Object,
      require: true
    }
  },
  data () {
    return {}
  },
  methods: {},
  computed: {},
  watch: {},
  filters: {},
  components: {},
  created () { },
  mounted () { }
}
</script>

<style scoped lang='less'>
.article-item {
  .van-cell__value {
    flex: unset;
  }
  .costom-label {
    color: #999;
    font-size: 23px;
    .common {
      margin: 0 10px;
    }
    .cover-img {
      display: flex;
      margin: 30px 0;
      .van-image {
        width: 232px;
        height: 146px;
      }
      .van-image:nth-child(2) {
        margin: 0 4px;
      }
    }
  }
  .right-img {
    width: 232px;
    height: 146px;
  }
}
</style>
